/*
 * Класс инкапсулирующий все dom операции CommentsContainer
 * 
 * @author Alexander Sibiryakov
 */
function CommentsContainerView(item_oid) {
	this.commentslist_id = "#commentslist"+item_oid;
	this.item_id = "#i"+item_oid;
	this.insertComments = function(html) { jQuery(this.commentslist_id).append(html); }
	this.insertCommentAfter = function(dom_elt, html) { jQuery(dom_elt).after(html); }
	this.getCommentOidByElt = function(dom_elt) { return jQuery(dom_elt).attr("id"); }
	this.getComments = function() { return jQuery(this.commentslist_id+">"+"div"); }
	this.getLoaders = function() { return jQuery(this.commentslist_id+">"+"a.cmore-"); }
	this.getOidByEltLoader = function(elt) { return jQuery(elt).attr("id"); }
	this.showContainer = function() { jQuery(this.commentslist_id).parent().show(); }
	this.hideContainer = function() { jQuery(this.commentslist_id).parent().hide(); }
	this.isEmptyContainer = function() { return jQuery(this.commentslist_id).size() == 0; }
	this.insertContainer = function(html) { jQuery(this.item_id).after(html); }
	this.isCommentsInDom = function() { return (jQuery(this.commentslist_id + ">div.citem-").size() > 0) ? true : false; }
	this.rmComments = function() { jQuery(this.commentslist_id + ">div.citem-").remove(); }
	this.hideComments = function() { jQuery(this.commentslist_id).hide(); }
	this.showComments = function() { jQuery(this.commentslist_id).show(); }
}